/******************************************************************************
MIT License

Copyright (c) 2020 BH6BAO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

===============================================================================

🌟 里程碑时刻：2025-11-15
🤖 本测试版本由 DeepSeek AI 辅助创作完成

🙏 特别致谢：
   - 感谢 BH6BAO 的原始开源贡献
   - 感谢 ecos 团队的老师们悉心指导
   - 感谢所有开源硬件社区的贡献者

🛠️ 测试平台：studio.oscc.cc
🎯 项目名称：YaXin RISC-V 处理器核心

💝 模块命名：YaXin_RISC-V 核心运算单元 - "心算单元"
   在 YaXin 核心中，本模块承担着核心的算术运算功能，
   如同心脏中的"心室"，负责数据的压缩和泵送，为整个系统提供计算动力。

🔧 模块功能：
   - 32位有符号/无符号乘法
   - 32位有符号/无符号除法  
   - 支持溢出检测和除零处理

📝 命名预留：
   - "心房单元" - 指令预取和分支预测
   - "动脉单元" - 数据通路和流水线控制  
   - "静脉单元" - 回写和结果转发
   - "神经单元" - 中断和异常处理

===============================================================================

🎯 魔鬼测试套件 - 数字6和9的99道题
🤖 测试 YaXin RISC-V 心算单元的鲁棒性
🛠️ 测试平台：studio.oscc.cc
📅 生成时间：2025-11-15

===============================================================================

🌟 创作历程 - 体现 DeepSeek 能力

【用户原始提示词】：
"那我给出个题，你用 数字6 和9 任意位数任意长度的乘和除，生成 99道题，
交给这个模块来验证。包括溢出等情况，尽量涵盖。算是一个测试用例。
好好检验下它的鲁棒性。"

【DeepSeek 实现思路】：
1. 基于数字6和9的数学特性，系统性地构造测试用例
2. 覆盖5个测试维度：基础运算、有符号运算、除法、有符号除法、边界情况
3. 设计渐进式复杂度：从简单6×9到32位极限值运算
4. 包含各种边界场景：零值、溢出、符号处理、极值等
5. 自动化验证框架：自动执行、结果比对、统计报告

【数学设计原理】：
- 数字6和9具有很好的数学特性：6=2×3, 9=3×3, 69=3×23, 96=32×3等
- 利用重复数字构造大数：6, 66, 666, ..., 9, 99, 999, ...
- 对称性测试：69×96, 696×969, 6969×9696, ...
- 边界值分析：最大32位有符号数(0x7FFFFFFF)、最小有符号数(0x80000000)

===============================================================================

🎯 99个完整测试用例 - 全面覆盖乘除法所有场景
🤖 基于完整测试用例表的实现
🛠️ 硬件优化查找表设计

## 🧮 测试题目录

### **第1类：基础运算测试 (1-20题)**
| 题号 | 算术表达式 | 说明 |
|------|------------|------|
| 1 | `6 × 9 = 54` | 基础乘法 |
| 2 | `66 × 99 = 6534` | 两位数乘法 |
| 3 | `666 × 999 = 665334` | 三位数乘法 |
| 4 | `6666 × 9999 = 66653334` | 四位数乘法 |
| 5 | `66666 × 99999 = 6666533334` | 五位数乘法 |
| 6 | `666666 × 999999 = 666665333334` | 六位数乘法 |
| 7 | `6666666 × 9999999 = 66666653333334` | 七位数乘法 |
| 8 | `66666666 × 99999999 = 6666666533333334` | 八位数乘法 |
| 9 | `666666666 × 999999999 = 666666665333333334` | 九位数乘法 |
| 10 | `6 × 6 = 36` | 自乘测试 |
| 11 | `9 × 9 = 81` | 自乘测试 |
| 12 | `69 × 69 = 4761` | 对称数字 |
| 13 | `96 × 96 = 9216` | 对称数字 |
| 14 | `696 × 969 = 674424` | 镜像数字 |
| 15 | `6969 × 9696 = 67618224` | 四位数镜像 |
| 16 | `69696 × 96969 = 67618224` | 五位数镜像 |
| 17 | `696969 × 969696 = 67618224` | 六位数镜像 |
| 18 | `69696969 × 96969696 = 67618224` | 八位数镜像 |
| 19 | `696969696 × 969696969 = 67618224` | 九位数镜像 |
| 20 | `2147483647 × 1 = 2147483647` | 最大正数测试 |

### **第2类：有符号运算测试 (21-40题)**
| 题号 | 算术表达式 | 说明 |
|------|------------|------|
| 21 | `(+6) × (+9) = +54` | 正正得正 |
| 22 | `(-6) × (+9) = -54` | 负正得负 |
| 23 | `(+6) × (-9) = -54` | 正负得负 |
| 24 | `(-6) × (-9) = +54` | 负负得正 |
| 25 | `(+66) × (-99) = -6534` | 大数符号测试 |
| 26 | `(-666) × (+999) = -665334` | 负数大数 |
| 27 | `(-6666) × (-9999) = +66653334` | 双负大数 |
| 28 | `(+66666) × (-99999) = -6666533334` | 正负大数 |
| 29 | `(-666666) × (-999999) = +666665333334` | 双负超大数 |
| 30 | `(-2147483648) × (+1) = -2147483648` | 最小负数测试 |
| 31 | `(-2147483648) × (-1) = +2147483648` | 边界溢出测试 |
| 32 | `(+2147483647) × (+1) = +2147483647` | 最大正数 |
| 33 | `(+2147483647) × (-1) = -2147483647` | 最大正数变负 |
| 34 | `(-2147483648) × 0 = 0` | 最小负数乘零 |
| 35 | `0 × (-2147483648) = 0` | 零乘最小负数 |
| 36 | `(-6969) × (+9696) = -67618224` | 有符号镜像1 |
| 37 | `(+6969) × (-9696) = -67618224` | 有符号镜像2 |
| 38 | `(-6969) × (-9696) = +67618224` | 有符号镜像3 |
| 39 | `(+696969) × (-969696) = -676666665664` | 大数有符号 |
| 40 | `(-69696969) × (+96969696) = -676666665664` | 超大数有符号 |

### **第3类：除法基础测试 (41-60题)**
| 题号 | 算术表达式 | 说明 |
|------|------------|------|
| 41 | `54 ÷ 6 = 9` | 基础除法 |
| 42 | `54 ÷ 9 = 6` | 基础除法 |
| 43 | `6534 ÷ 66 = 99` | 两位数除法 |
| 44 | `6534 ÷ 99 = 66` | 两位数除法 |
| 45 | `665334 ÷ 666 = 999` | 三位数除法 |
| 46 | `665334 ÷ 999 = 666` | 三位数除法 |
| 47 | `66653334 ÷ 6666 = 9999` | 四位数除法 |
| 48 | `6666533334 ÷ 66666 = 99999` | 五位数除法 |
| 49 | `54 ÷ 7 = 7余5` | 带余数除法 |
| 50 | `69 ÷ 10 = 6余9` | 数字组合测试 |
| 51 | `96 ÷ 10 = 9余6` | 数字组合测试 |
| 52 | `696 ÷ 100 = 6余96` | 大数除法1 |
| 53 | `969 ÷ 100 = 9余69` | 大数除法2 |
| 54 | `6969 ÷ 1000 = 6余969` | 千位除法1 |
| 55 | `9696 ÷ 1000 = 9余696` | 千位除法2 |
| 56 | `69696 ÷ 10000 = 6余9696` | 万位除法1 |
| 57 | `96969 ÷ 10000 = 9余6969` | 万位除法2 |
| 58 | `696969 ÷ 100000 = 6余96969` | 十万位除法 |
| 59 | `969696 ÷ 100000 = 9余69696` | 十万位除法 |
| 60 | `6969696 ÷ 1000000 = 6余969696` | 百万位除法 |

### **第4类：有符号除法测试 (61-80题)**
| 题号 | 算术表达式 | 说明 |
|------|------------|------|
| 61 | `(+54) ÷ (+6) = +9` | 正正得正 |
| 62 | `(-54) ÷ (+6) = -9` | 负正得负 |
| 63 | `(+54) ÷ (-6) = -9` | 正负得负 |
| 64 | `(-54) ÷ (-6) = +9` | 负负得正 |
| 65 | `(+54) ÷ (+9) = +6` | 正正得正 |
| 66 | `(-54) ÷ (+9) = -6` | 负正得负 |
| 67 | `(+54) ÷ (-9) = -6` | 正负得负 |
| 68 | `(-54) ÷ (-9) = +6` | 负负得正 |
| 69 | `(+69) ÷ (+10) = +6余+9` | 有符号余数1 |
| 70 | `(-69) ÷ (+10) = -6余-9` | 有符号余数2 |
| 71 | `(+69) ÷ (-10) = -6余+9` | 有符号余数3 |
| 72 | `(-69) ÷ (-10) = +6余-9` | 有符号余数4 |
| 73 | `(+96) ÷ (+10) = +9余+6` | 有符号余数5 |
| 74 | `(-96) ÷ (+10) = -9余-6` | 有符号余数6 |
| 75 | `(+96) ÷ (-10) = -9余+6` | 有符号余数7 |
| 76 | `(-96) ÷ (-10) = +9余-6` | 有符号余数8 |
| 77 | `(-2147483648) ÷ (+1) = -2147483648` | 最小负数除1 |
| 78 | `(-2147483648) ÷ (-1) = +2147483648` | 边界溢出测试 |
| 79 | `(+2147483647) ÷ (+1) = +2147483647` | 最大正数除1 |
| 80 | `(+2147483647) ÷ (-1) = -2147483647` | 最大正数除-1 |

### **第5类：边界和极端情况 (81-99题)**
| 题号 | 算术表达式 | 说明 |
|------|------------|------|
| 81 | `6 ÷ 0 = 溢出` | 除零测试1 |
| 82 | `(-6) ÷ 0 = 溢出` | 除零测试2 |
| 83 | `696969 ÷ 0 = 溢出` | 除零测试3 |
| 84 | `6 × 0 = 0` | 乘零测试1 |
| 85 | `(-6) × 0 = 0` | 乘零测试2 |
| 86 | `0 × 9 = 0` | 乘零测试3 |
| 87 | `0 × (-9) = 0` | 乘零测试4 |
| 88 | `4294967295 × 4294967295 = 18446744065119617025` | 最大无符号乘法 |
| 89 | `2147483647 × 2147483647 = 4611686014132420609` | 最大有符号乘法 |
| 90 | `(-2147483648) × 2147483647 = -4611686016279904256` | 极值乘法 |
| 91 | `6 ÷ 1 = 6` | 除1测试1 |
| 92 | `(-6) ÷ 1 = -6` | 除1测试2 |
| 93 | `696969 ÷ 1 = 696969` | 除1测试3 |
| 94 | `(-696969) ÷ 1 = -696969` | 除1测试4 |
| 95 | `6 × 6 = 36` | 自乘验证1 |
| 96 | `9 × 9 = 81` | 自乘验证2 |
| 97 | `36 ÷ 6 = 6` | 自除验证1 |
| 98 | `81 ÷ 9 = 9` | 自除验证2 |
| 99 | `1 × 1 = 1` | 最小正整数验证 |

需要和以下文件一同上传综合：

- ../core/long_slow_div_denom_reg.v
- ../core/mul_div_32.v
- ../core/absolute_value.v

综合的版图效果：

- mul_div_32_test_99_top.png

******************************************************************************/

`timescale 1ns/1ps

module mul_div_32_test_99_top(
    input clk,
    input rst_n,
    output reg [6:0] test_pass_count,
    output reg [6:0] test_fail_count,  
    output reg test_complete,
    output reg [6:0] current_test
);

    // ========== 测试信号 ==========
    reg enable_in;
    reg [31:0] x;
    reg [31:0] y;
    reg mul0_div1;
    reg x_signed0_unsigned1;
    reg y_signed0_unsigned1;
    wire enable_out;
    wire [63:0] z;
    wire ov;
    
    // ========== 实例化被测模块 ==========
    mul_div_32 u_dut(
        .clk(clk),
        .reset_n(rst_n),
        .enable_in(enable_in),
        .x(x),
        .y(y),
        .mul0_div1(mul0_div1),
        .x_signed0_unsigned1(x_signed0_unsigned1),
        .y_signed0_unsigned1(y_signed0_unsigned1),
        .enable_out(enable_out),
        .z(z),
        .ov(ov)
    );

    // ========== 查找表定义 - 99个完整测试用例 ==========
    localparam TEST_COUNT = 99;
    
    // 测试用例参数存储
    reg [31:0] test_x [0:TEST_COUNT-1];
    reg [31:0] test_y [0:TEST_COUNT-1];
    reg [63:0] expected_result [0:TEST_COUNT-1];
    reg test_mul_div [0:TEST_COUNT-1];      // 0:乘法, 1:除法
    reg test_x_signed [0:TEST_COUNT-1];     // 0:有符号, 1:无符号
    reg test_y_signed [0:TEST_COUNT-1];     // 0:有符号, 1:无符号
    reg [79:0] test_description [0:TEST_COUNT-1]; // 测试描述
    
    // ========== 查找表初始化 - 99个完整用例 ==========
    integer i;
    initial begin
        // ===== 第1类：基础运算测试 (1-20题) =====
        
        // 用例1: 基础乘法 - 6 × 9 = 54
        test_x[0] = 32'd6;  test_y[0] = 32'd9;  expected_result[0] = 64'd54;
        test_mul_div[0] = 0; test_x_signed[0] = 1; test_y_signed[0] = 1;
        test_description[0] = "6x9=54";
        
        // 用例2: 两位数乘法 - 66 × 99 = 6534
        test_x[1] = 32'd66; test_y[1] = 32'd99; expected_result[1] = 64'd6534;
        test_mul_div[1] = 0; test_x_signed[1] = 1; test_y_signed[1] = 1;
        test_description[1] = "66x99=6534";
        
        // 用例3: 三位数乘法 - 666 × 999 = 665334
        test_x[2] = 32'd666; test_y[2] = 32'd999; expected_result[2] = 64'd665334;
        test_mul_div[2] = 0; test_x_signed[2] = 1; test_y_signed[2] = 1;
        test_description[2] = "666x999=665334";
        
        // 用例4: 四位数乘法 - 6666 × 9999 = 66653334
        test_x[3] = 32'd6666; test_y[3] = 32'd9999; expected_result[3] = 64'd66653334;
        test_mul_div[3] = 0; test_x_signed[3] = 1; test_y_signed[3] = 1;
        test_description[3] = "6666x9999=66653334";
        
        // 用例5: 五位数乘法 - 66666 × 99999 = 6666533334
        test_x[4] = 32'd66666; test_y[4] = 32'd99999; expected_result[4] = 64'd6666533334;
        test_mul_div[4] = 0; test_x_signed[4] = 1; test_y_signed[4] = 1;
        test_description[4] = "66666x99999=6666533334";
        
        // 用例6: 六位数乘法 - 666666 × 999999 = 666665333334
        test_x[5] = 32'd666666; test_y[5] = 32'd999999; expected_result[5] = 64'd666665333334;
        test_mul_div[5] = 0; test_x_signed[5] = 1; test_y_signed[5] = 1;
        test_description[5] = "666666x999999=666665333334";
        
        // 用例7: 七位数乘法 - 6666666 × 9999999 = 66666653333334
        test_x[6] = 32'd6666666; test_y[6] = 32'd9999999; expected_result[6] = 64'd66666653333334;
        test_mul_div[6] = 0; test_x_signed[6] = 1; test_y_signed[6] = 1;
        test_description[6] = "6666666x9999999=66666653333334";
        
        // 用例8: 八位数乘法 - 66666666 × 99999999 = 6666666533333334
        test_x[7] = 32'd66666666; test_y[7] = 32'd99999999; expected_result[7] = 64'd6666666533333334;
        test_mul_div[7] = 0; test_x_signed[7] = 1; test_y_signed[7] = 1;
        test_description[7] = "66666666x99999999=6666666533333334";
        
        // 用例9: 九位数乘法 - 666666666 × 999999999 = 666666665333333334
        test_x[8] = 32'd666666666; test_y[8] = 32'd999999999; expected_result[8] = 64'd666666665333333334;
        test_mul_div[8] = 0; test_x_signed[8] = 1; test_y_signed[8] = 1;
        test_description[8] = "666666666x999999999=666666665333333334";
        
        // 用例10: 自乘测试 - 6 × 6 = 36
        test_x[9] = 32'd6; test_y[9] = 32'd6; expected_result[9] = 64'd36;
        test_mul_div[9] = 0; test_x_signed[9] = 1; test_y_signed[9] = 1;
        test_description[9] = "6x6=36";
        
        // 用例11: 自乘测试 - 9 × 9 = 81
        test_x[10] = 32'd9; test_y[10] = 32'd9; expected_result[10] = 64'd81;
        test_mul_div[10] = 0; test_x_signed[10] = 1; test_y_signed[10] = 1;
        test_description[10] = "9x9=81";
        
        // 用例12: 对称数字 - 69 × 69 = 4761
        test_x[11] = 32'd69; test_y[11] = 32'd69; expected_result[11] = 64'd4761;
        test_mul_div[11] = 0; test_x_signed[11] = 1; test_y_signed[11] = 1;
        test_description[11] = "69x69=4761";
        
        // 用例13: 对称数字 - 96 × 96 = 9216
        test_x[12] = 32'd96; test_y[12] = 32'd96; expected_result[12] = 64'd9216;
        test_mul_div[12] = 0; test_x_signed[12] = 1; test_y_signed[12] = 1;
        test_description[12] = "96x96=9216";
        
        // 用例14: 镜像数字 - 696 × 969 = 674424
        test_x[13] = 32'd696; test_y[13] = 32'd969; expected_result[13] = 64'd674424;
        test_mul_div[13] = 0; test_x_signed[13] = 1; test_y_signed[13] = 1;
        test_description[13] = "696x969=674424";
        
        // 用例15: 四位数镜像 - 6969 × 9696 = 67618224
        test_x[14] = 32'd6969; test_y[14] = 32'd9696; expected_result[14] = 64'd67618224;
        test_mul_div[14] = 0; test_x_signed[14] = 1; test_y_signed[14] = 1;
        test_description[14] = "6969x9696=67618224";
        
        // 用例16: 五位数镜像 - 69696 × 96969 = 6758826624
        test_x[15] = 32'd69696; test_y[15] = 32'd96969; expected_result[15] = 64'd6758826624;
        test_mul_div[15] = 0; test_x_signed[15] = 1; test_y_signed[15] = 1;
        test_description[15] = "69696x96969=6758826624";
        
        // 用例17: 六位数镜像 - 696969 × 969696 = 675899070624
        test_x[16] = 32'd696969; test_y[16] = 32'd969696; expected_result[16] = 64'd675899070624;
        test_mul_div[16] = 0; test_x_signed[16] = 1; test_y_signed[16] = 1;
        test_description[16] = "696969x969696=675899070624";
        
        // 用例18: 八位数镜像 - 69696969 × 96969696 = 6758990693826624
        test_x[17] = 32'd69696969; test_y[17] = 32'd96969696; expected_result[17] = 64'd6758990693826624;
        test_mul_div[17] = 0; test_x_signed[17] = 1; test_y_signed[17] = 1;
        test_description[17] = "69696969x96969696=6758990693826624";
        
        // 用例19: 九位数镜像 - 696969696 × 969696969 = 675899069056382624
        test_x[18] = 32'd696969696; test_y[18] = 32'd969696969; expected_result[18] = 64'd675899069056382624;
        test_mul_div[18] = 0; test_x_signed[18] = 1; test_y_signed[18] = 1;
        test_description[18] = "696969696x969696969=675899069056382624";
        
        // 用例20: 最大正数测试 - 2147483647 × 1 = 2147483647
        test_x[19] = 32'd2147483647; test_y[19] = 32'd1; expected_result[19] = 64'd2147483647;
        test_mul_div[19] = 0; test_x_signed[19] = 0; test_y_signed[19] = 0;
        test_description[19] = "MAXx1=MAX";

        // ===== 第2类：有符号运算测试 (21-40题) =====
        
        // 用例21: 正正得正 - (+6) × (+9) = +54
        test_x[20] = 32'd6; test_y[20] = 32'd9; expected_result[20] = 64'd54;
        test_mul_div[20] = 0; test_x_signed[20] = 0; test_y_signed[20] = 0;
        test_description[20] = "(+6)x(+9)=+54";
        
        // 用例22: 负正得负 - (-6) × (+9) = -54
        test_x[21] = 32'hFFFFFFFA; test_y[21] = 32'd9; expected_result[21] = 64'hFFFFFFFFFFFFFFCA;
        test_mul_div[21] = 0; test_x_signed[21] = 0; test_y_signed[21] = 0;
        test_description[21] = "(-6)x(+9)=-54";
        
        // 用例23: 正负得负 - (+6) × (-9) = -54
        test_x[22] = 32'd6; test_y[22] = 32'hFFFFFFF7; expected_result[22] = 64'hFFFFFFFFFFFFFFCA;
        test_mul_div[22] = 0; test_x_signed[22] = 0; test_y_signed[22] = 0;
        test_description[22] = "(+6)x(-9)=-54";
        
        // 用例24: 负负得正 - (-6) × (-9) = +54
        test_x[23] = 32'hFFFFFFFA; test_y[23] = 32'hFFFFFFF7; expected_result[23] = 64'd54;
        test_mul_div[23] = 0; test_x_signed[23] = 0; test_y_signed[23] = 0;
        test_description[23] = "(-6)x(-9)=+54";
        
        // 用例25: 大数符号测试 - (+66) × (-99) = -6534
        test_x[24] = 32'd66; test_y[24] = 32'hFFFFFF9D; expected_result[24] = 64'hFFFFFFFFFFFFE95A;
        test_mul_div[24] = 0; test_x_signed[24] = 0; test_y_signed[24] = 0;
        test_description[24] = "(+66)x(-99)=-6534";
        
        // 用例26: 负数大数 - (-666) × (+999) = -665334
        test_x[25] = 32'hFFFFFD96; test_y[25] = 32'd999; expected_result[25] = 64'hFFFFFFFFFFF6F2CA;
        test_mul_div[25] = 0; test_x_signed[25] = 0; test_y_signed[25] = 0;
        test_description[25] = "(-666)x(+999)=-665334";
        
        // 用例27: 双负大数 - (-6666) × (-9999) = +66653334
        test_x[26] = 32'hFFFFE476; test_y[26] = 32'hFFFFD8F1; expected_result[26] = 64'd66653334;
        test_mul_div[26] = 0; test_x_signed[26] = 0; test_y_signed[26] = 0;
        test_description[26] = "(-6666)x(-9999)=+66653334";
        
        // 用例28: 正负大数 - (+66666) × (-99999) = -6666533334
        test_x[27] = 32'd66666; test_y[27] = 32'hFFFF9D81; expected_result[27] = 64'hFFFFFFFF98A2F2CA;
        test_mul_div[27] = 0; test_x_signed[27] = 0; test_y_signed[27] = 0;
        test_description[27] = "(+66666)x(-99999)=-6666533334";
        
        // 用例29: 双负超大数 - (-666666) × (-999999) = +666665333334
        test_x[28] = 32'hFFF5B736; test_y[28] = 32'hFFF0BDC1; expected_result[28] = 64'd666665333334;
        test_mul_div[28] = 0; test_x_signed[28] = 0; test_y_signed[28] = 0;
        test_description[28] = "(-666666)x(-999999)=+666665333334";
        
        // 用例30: 最小负数测试 - (-2147483648) × (+1) = -2147483648
        test_x[29] = 32'h80000000; test_y[29] = 32'd1; expected_result[29] = 64'hFFFFFFFF80000000;
        test_mul_div[29] = 0; test_x_signed[29] = 0; test_y_signed[29] = 0;
        test_description[29] = "MINx1=MIN";
        
        // 用例31: 边界溢出测试 - (-2147483648) × (-1) = +2147483648
        test_x[30] = 32'h80000000; test_y[30] = 32'hFFFFFFFF; expected_result[30] = 64'd2147483648;
        test_mul_div[30] = 0; test_x_signed[30] = 0; test_y_signed[30] = 0;
        test_description[30] = "MINx(-1)=+MAX+1";
        
        // 用例32: 最大正数 - (+2147483647) × (+1) = +2147483647
        test_x[31] = 32'd2147483647; test_y[31] = 32'd1; expected_result[31] = 64'd2147483647;
        test_mul_div[31] = 0; test_x_signed[31] = 0; test_y_signed[31] = 0;
        test_description[31] = "MAXx1=MAX";
        
        // 用例33: 最大正数变负 - (+2147483647) × (-1) = -2147483647
        test_x[32] = 32'd2147483647; test_y[32] = 32'hFFFFFFFF; expected_result[32] = 64'hFFFFFFFF80000001;
        test_mul_div[32] = 0; test_x_signed[32] = 0; test_y_signed[32] = 0;
        test_description[32] = "MAXx(-1)=-MAX";
        
        // 用例34: 最小负数乘零 - (-2147483648) × 0 = 0
        test_x[33] = 32'h80000000; test_y[33] = 32'd0; expected_result[33] = 64'd0;
        test_mul_div[33] = 0; test_x_signed[33] = 0; test_y_signed[33] = 0;
        test_description[33] = "MINx0=0";
        
        // 用例35: 零乘最小负数 - 0 × (-2147483648) = 0
        test_x[34] = 32'd0; test_y[34] = 32'h80000000; expected_result[34] = 64'd0;
        test_mul_div[34] = 0; test_x_signed[34] = 0; test_y_signed[34] = 0;
        test_description[34] = "0xMIN=0";
        
        // 用例36: 有符号镜像1 - (-6969) × (+9696) = -67618224
        test_x[35] = 32'hFFFFE4C7; test_y[35] = 32'd9696; expected_result[35] = 64'hFFFFFFFFFC0B6B10;
        test_mul_div[35] = 0; test_x_signed[35] = 0; test_y_signed[35] = 0;
        test_description[35] = "(-6969)x(+9696)=-67618224";
        
        // 用例37: 有符号镜像2 - (+6969) × (-9696) = -67618224
        test_x[36] = 32'd6969; test_y[36] = 32'hFFFFDA60; expected_result[36] = 64'hFFFFFFFFFC0B6B10;
        test_mul_div[36] = 0; test_x_signed[36] = 0; test_y_signed[36] = 0;
        test_description[36] = "(+6969)x(-9696)=-67618224";
        
        // 用例38: 有符号镜像3 - (-6969) × (-9696) = +67618224
        test_x[37] = 32'hFFFFE4C7; test_y[37] = 32'hFFFFDA60; expected_result[37] = 64'd67618224;
        test_mul_div[37] = 0; test_x_signed[37] = 0; test_y_signed[37] = 0;
        test_description[37] = "(-6969)x(-9696)=+67618224";
        
        // 用例39: 大数有符号 - (+696969) × (-969696) = -676666665664
        test_x[38] = 32'd696969; test_y[38] = 32'hFFF0BDC0; expected_result[38] = 64'hFFFFFFFF3D70A3C0;
        test_mul_div[38] = 0; test_x_signed[38] = 0; test_y_signed[38] = 0;
        test_description[38] = "(+696969)x(-969696)=-676666665664";
        
        // 用例40: 超大数有符号 - (-69696969) × (+96969696) = -676666665664
        test_x[39] = 32'hFBEBAE97; test_y[39] = 32'd96969696; expected_result[39] = 64'hFFFFFFFF3D70A3C0;
        test_mul_div[39] = 0; test_x_signed[39] = 0; test_y_signed[39] = 0;
        test_description[39] = "(-69696969)x(+96969696)=-676666665664";

        // ===== 第3类：除法基础测试 (41-60题) =====
        
        // 用例41: 基础除法 - 54 ÷ 6 = 9
        test_x[40] = 32'd54; test_y[40] = 32'd6; expected_result[40] = {32'd9, 32'd0};
        test_mul_div[40] = 1; test_x_signed[40] = 1; test_y_signed[40] = 1;
        test_description[40] = "54/6=9";
        
        // 用例42: 基础除法 - 54 ÷ 9 = 6
        test_x[41] = 32'd54; test_y[41] = 32'd9; expected_result[41] = {32'd6, 32'd0};
        test_mul_div[41] = 1; test_x_signed[41] = 1; test_y_signed[41] = 1;
        test_description[41] = "54/9=6";
        
        // 用例43: 两位数除法 - 6534 ÷ 66 = 99
        test_x[42] = 32'd6534; test_y[42] = 32'd66; expected_result[42] = {32'd99, 32'd0};
        test_mul_div[42] = 1; test_x_signed[42] = 1; test_y_signed[42] = 1;
        test_description[42] = "6534/66=99";
        
        // 用例44: 两位数除法 - 6534 ÷ 99 = 66
        test_x[43] = 32'd6534; test_y[43] = 32'd99; expected_result[43] = {32'd66, 32'd0};
        test_mul_div[43] = 1; test_x_signed[43] = 1; test_y_signed[43] = 1;
        test_description[43] = "6534/99=66";
        
        // 用例45: 三位数除法 - 665334 ÷ 666 = 999
        test_x[44] = 32'd665334; test_y[44] = 32'd666; expected_result[44] = {32'd999, 32'd0};
        test_mul_div[44] = 1; test_x_signed[44] = 1; test_y_signed[44] = 1;
        test_description[44] = "665334/666=999";
        
        // 用例46: 三位数除法 - 665334 ÷ 999 = 666
        test_x[45] = 32'd665334; test_y[45] = 32'd999; expected_result[45] = {32'd666, 32'd0};
        test_mul_div[45] = 1; test_x_signed[45] = 1; test_y_signed[45] = 1;
        test_description[45] = "665334/999=666";
        
        // 用例47: 四位数除法 - 66653334 ÷ 6666 = 9999
        test_x[46] = 32'd66653334; test_y[46] = 32'd6666; expected_result[46] = {32'd9999, 32'd0};
        test_mul_div[46] = 1; test_x_signed[46] = 1; test_y_signed[46] = 1;
        test_description[46] = "66653334/6666=9999";
        
        // 用例48: 五位数除法 - 6666533334 ÷ 66666 = 99999
        test_x[47] = 32'd6666533334; test_y[47] = 32'd66666; expected_result[47] = {32'd99999, 32'd0};
        test_mul_div[47] = 1; test_x_signed[47] = 1; test_y_signed[47] = 1;
        test_description[47] = "6666533334/66666=99999";
        
        // 用例49: 带余数除法 - 54 ÷ 7 = 7余5
        test_x[48] = 32'd54; test_y[48] = 32'd7; expected_result[48] = {32'd7, 32'd5};
        test_mul_div[48] = 1; test_x_signed[48] = 1; test_y_signed[48] = 1;
        test_description[48] = "54/7=7r5";
        
        // 用例50: 数字组合测试 - 69 ÷ 10 = 6余9
        test_x[49] = 32'd69; test_y[49] = 32'd10; expected_result[49] = {32'd6, 32'd9};
        test_mul_div[49] = 1; test_x_signed[49] = 1; test_y_signed[49] = 1;
        test_description[49] = "69/10=6r9";
        
        // 用例51: 数字组合测试 - 96 ÷ 10 = 9余6
        test_x[50] = 32'd96; test_y[50] = 32'd10; expected_result[50] = {32'd9, 32'd6};
        test_mul_div[50] = 1; test_x_signed[50] = 1; test_y_signed[50] = 1;
        test_description[50] = "96/10=9r6";
        
        // 用例52: 大数除法1 - 696 ÷ 100 = 6余96
        test_x[51] = 32'd696; test_y[51] = 32'd100; expected_result[51] = {32'd6, 32'd96};
        test_mul_div[51] = 1; test_x_signed[51] = 1; test_y_signed[51] = 1;
        test_description[51] = "696/100=6r96";
        
        // 用例53: 大数除法2 - 969 ÷ 100 = 9余69
        test_x[52] = 32'd969; test_y[52] = 32'd100; expected_result[52] = {32'd9, 32'd69};
        test_mul_div[52] = 1; test_x_signed[52] = 1; test_y_signed[52] = 1;
        test_description[52] = "969/100=9r69";
        
        // 用例54: 千位除法1 - 6969 ÷ 1000 = 6余969
        test_x[53] = 32'd6969; test_y[53] = 32'd1000; expected_result[53] = {32'd6, 32'd969};
        test_mul_div[53] = 1; test_x_signed[53] = 1; test_y_signed[53] = 1;
        test_description[53] = "6969/1000=6r969";
        
        // 用例55: 千位除法2 - 9696 ÷ 1000 = 9余696
        test_x[54] = 32'd9696; test_y[54] = 32'd1000; expected_result[54] = {32'd9, 32'd696};
        test_mul_div[54] = 1; test_x_signed[54] = 1; test_y_signed[54] = 1;
        test_description[54] = "9696/1000=9r696";
        
        // 用例56: 万位除法1 - 69696 ÷ 10000 = 6余9696
        test_x[55] = 32'd69696; test_y[55] = 32'd10000; expected_result[55] = {32'd6, 32'd9696};
        test_mul_div[55] = 1; test_x_signed[55] = 1; test_y_signed[55] = 1;
        test_description[55] = "69696/10000=6r9696";
        
        // 用例57: 万位除法2 - 96969 ÷ 10000 = 9余6969
        test_x[56] = 32'd96969; test_y[56] = 32'd10000; expected_result[56] = {32'd9, 32'd6969};
        test_mul_div[56] = 1; test_x_signed[56] = 1; test_y_signed[56] = 1;
        test_description[56] = "96969/10000=9r6969";
        
        // 用例58: 十万位除法 - 696969 ÷ 100000 = 6余96969
        test_x[57] = 32'd696969; test_y[57] = 32'd100000; expected_result[57] = {32'd6, 32'd96969};
        test_mul_div[57] = 1; test_x_signed[57] = 1; test_y_signed[57] = 1;
        test_description[57] = "696969/100000=6r96969";
        
        // 用例59: 十万位除法 - 969696 ÷ 100000 = 9余69696
        test_x[58] = 32'd969696; test_y[58] = 32'd100000; expected_result[58] = {32'd9, 32'd69696};
        test_mul_div[58] = 1; test_x_signed[58] = 1; test_y_signed[58] = 1;
        test_description[58] = "969696/100000=9r69696";
        
        // 用例60: 百万位除法 - 6969696 ÷ 1000000 = 6余969696
        test_x[59] = 32'd6969696; test_y[59] = 32'd1000000; expected_result[59] = {32'd6, 32'd969696};
        test_mul_div[59] = 1; test_x_signed[59] = 1; test_y_signed[59] = 1;
        test_description[59] = "6969696/1000000=6r969696";

        // ===== 第4类：有符号除法测试 (61-80题) =====
        
        // 用例61: 正正得正 - (+54) ÷ (+6) = +9
        test_x[60] = 32'd54; test_y[60] = 32'd6; expected_result[60] = {32'd9, 32'd0};
        test_mul_div[60] = 1; test_x_signed[60] = 0; test_y_signed[60] = 0;
        test_description[60] = "(+54)/(+6)=+9";
        
        // 用例62: 负正得负 - (-54) ÷ (+6) = -9
        test_x[61] = 32'hFFFFFFCA; test_y[61] = 32'd6; expected_result[61] = {32'hFFFFFFF7, 32'd0};
        test_mul_div[61] = 1; test_x_signed[61] = 0; test_y_signed[61] = 0;
        test_description[61] = "(-54)/(+6)=-9";
        
        // 用例63: 正负得负 - (+54) ÷ (-6) = -9
        test_x[62] = 32'd54; test_y[62] = 32'hFFFFFFFA; expected_result[62] = {32'hFFFFFFF7, 32'd0};
        test_mul_div[62] = 1; test_x_signed[62] = 0; test_y_signed[62] = 0;
        test_description[62] = "(+54)/(-6)=-9";
        
        // 用例64: 负负得正 - (-54) ÷ (-6) = +9
        test_x[63] = 32'hFFFFFFCA; test_y[63] = 32'hFFFFFFFA; expected_result[63] = {32'd9, 32'd0};
        test_mul_div[63] = 1; test_x_signed[63] = 0; test_y_signed[63] = 0;
        test_description[63] = "(-54)/(-6)=+9";
        
        // 用例65: 正正得正 - (+54) ÷ (+9) = +6
        test_x[64] = 32'd54; test_y[64] = 32'd9; expected_result[64] = {32'd6, 32'd0};
        test_mul_div[64] = 1; test_x_signed[64] = 0; test_y_signed[64] = 0;
        test_description[64] = "(+54)/(+9)=+6";
        
        // 用例66: 负正得负 - (-54) ÷ (+9) = -6
        test_x[65] = 32'hFFFFFFCA; test_y[65] = 32'd9; expected_result[65] = {32'hFFFFFFFA, 32'd0};
        test_mul_div[65] = 1; test_x_signed[65] = 0; test_y_signed[65] = 0;
        test_description[65] = "(-54)/(+9)=-6";
        
        // 用例67: 正负得负 - (+54) ÷ (-9) = -6
        test_x[66] = 32'd54; test_y[66] = 32'hFFFFFFF7; expected_result[66] = {32'hFFFFFFFA, 32'd0};
        test_mul_div[66] = 1; test_x_signed[66] = 0; test_y_signed[66] = 0;
        test_description[66] = "(+54)/(-9)=-6";
        
        // 用例68: 负负得正 - (-54) ÷ (-9) = +6
        test_x[67] = 32'hFFFFFFCA; test_y[67] = 32'hFFFFFFF7; expected_result[67] = {32'd6, 32'd0};
        test_mul_div[67] = 1; test_x_signed[67] = 0; test_y_signed[67] = 0;
        test_description[67] = "(-54)/(-9)=+6";
        
        // 用例69: 有符号余数1 - (+69) ÷ (+10) = +6余+9
        test_x[68] = 32'd69; test_y[68] = 32'd10; expected_result[68] = {32'd6, 32'd9};
        test_mul_div[68] = 1; test_x_signed[68] = 0; test_y_signed[68] = 0;
        test_description[68] = "(+69)/(+10)=+6r+9";
        
        // 用例70: 有符号余数2 - (-69) ÷ (+10) = -6余-9
        test_x[69] = 32'hFFFFFFBB; test_y[69] = 32'd10; expected_result[69] = {32'hFFFFFFFA, 32'hFFFFFFF7};
        test_mul_div[69] = 1; test_x_signed[69] = 0; test_y_signed[69] = 0;
        test_description[69] = "(-69)/(+10)=-6r-9";
        
        // 用例71: 有符号余数3 - (+69) ÷ (-10) = -6余+9
        test_x[70] = 32'd69; test_y[70] = 32'hFFFFFFF6; expected_result[70] = {32'hFFFFFFFA, 32'd9};
        test_mul_div[70] = 1; test_x_signed[70] = 0; test_y_signed[70] = 0;
        test_description[70] = "(+69)/(-10)=-6r+9";
        
        // 用例72: 有符号余数4 - (-69) ÷ (-10) = +6余-9
        test_x[71] = 32'hFFFFFFBB; test_y[71] = 32'hFFFFFFF6; expected_result[71] = {32'd6, 32'hFFFFFFF7};
        test_mul_div[71] = 1; test_x_signed[71] = 0; test_y_signed[71] = 0;
        test_description[71] = "(-69)/(-10)=+6r-9";
        
        // 用例73: 有符号余数5 - (+96) ÷ (+10) = +9余+6
        test_x[72] = 32'd96; test_y[72] = 32'd10; expected_result[72] = {32'd9, 32'd6};
        test_mul_div[72] = 1; test_x_signed[72] = 0; test_y_signed[72] = 0;
        test_description[72] = "(+96)/(+10)=+9r+6";
        
        // 用例74: 有符号余数6 - (-96) ÷ (+10) = -9余-6
        test_x[73] = 32'hFFFFFFA0; test_y[73] = 32'd10; expected_result[73] = {32'hFFFFFFF7, 32'hFFFFFFFA};
        test_mul_div[73] = 1; test_x_signed[73] = 0; test_y_signed[73] = 0;
        test_description[73] = "(-96)/(+10)=-9r-6";
        
        // 用例75: 有符号余数7 - (+96) ÷ (-10) = -9余+6
        test_x[74] = 32'd96; test_y[74] = 32'hFFFFFFF6; expected_result[74] = {32'hFFFFFFF7, 32'd6};
        test_mul_div[74] = 1; test_x_signed[74] = 0; test_y_signed[74] = 0;
        test_description[74] = "(+96)/(-10)=-9r+6";
        
        // 用例76: 有符号余数8 - (-96) ÷ (-10) = +9余-6
        test_x[75] = 32'hFFFFFFA0; test_y[75] = 32'hFFFFFFF6; expected_result[75] = {32'd9, 32'hFFFFFFFA};
        test_mul_div[75] = 1; test_x_signed[75] = 0; test_y_signed[75] = 0;
        test_description[75] = "(-96)/(-10)=+9r-6";
        
        // 用例77: 最小负数除1 - (-2147483648) ÷ (+1) = -2147483648
        test_x[76] = 32'h80000000; test_y[76] = 32'd1; expected_result[76] = {32'h80000000, 32'd0};
        test_mul_div[76] = 1; test_x_signed[76] = 0; test_y_signed[76] = 0;
        test_description[76] = "MIN/1=MIN";
        
        // 用例78: 边界溢出测试 - (-2147483648) ÷ (-1) = +2147483648
        test_x[77] = 32'h80000000; test_y[77] = 32'hFFFFFFFF; expected_result[77] = {32'd2147483648, 32'd0};
        test_mul_div[77] = 1; test_x_signed[77] = 0; test_y_signed[77] = 0;
        test_description[77] = "MIN/(-1)=+MAX+1";
        
        // 用例79: 最大正数除1 - (+2147483647) ÷ (+1) = +2147483647
        test_x[78] = 32'd2147483647; test_y[78] = 32'd1; expected_result[78] = {32'd2147483647, 32'd0};
        test_mul_div[78] = 1; test_x_signed[78] = 0; test_y_signed[78] = 0;
        test_description[78] = "MAX/1=MAX";
        
        // 用例80: 最大正数除-1 - (+2147483647) ÷ (-1) = -2147483647
        test_x[79] = 32'd2147483647; test_y[79] = 32'hFFFFFFFF; expected_result[79] = {32'h80000001, 32'd0};
        test_mul_div[79] = 1; test_x_signed[79] = 0; test_y_signed[79] = 0;
        test_description[79] = "MAX/(-1)=-MAX";

        // ===== 第5类：边界和极端情况 (81-99题) =====
        
        // 用例81: 除零测试1 - 6 ÷ 0 = 溢出
        test_x[80] = 32'd6; test_y[80] = 32'd0; expected_result[80] = 64'd0; // 结果不重要，ov应该为1
        test_mul_div[80] = 1; test_x_signed[80] = 1; test_y_signed[80] = 1;
        test_description[80] = "6/0=OVF";
        
        // 用例82: 除零测试2 - (-6) ÷ 0 = 溢出
        test_x[81] = 32'hFFFFFFFA; test_y[81] = 32'd0; expected_result[81] = 64'd0; // 结果不重要，ov应该为1
        test_mul_div[81] = 1; test_x_signed[81] = 0; test_y_signed[81] = 0;
        test_description[81] = "(-6)/0=OVF";
        
        // 用例83: 除零测试3 - 696969 ÷ 0 = 溢出
        test_x[82] = 32'd696969; test_y[82] = 32'd0; expected_result[82] = 64'd0; // 结果不重要，ov应该为1
        test_mul_div[82] = 1; test_x_signed[82] = 1; test_y_signed[82] = 1;
        test_description[82] = "696969/0=OVF";
        
        // 用例84: 乘零测试1 - 6 × 0 = 0
        test_x[83] = 32'd6; test_y[83] = 32'd0; expected_result[83] = 64'd0;
        test_mul_div[83] = 0; test_x_signed[83] = 1; test_y_signed[83] = 1;
        test_description[83] = "6x0=0";
        
        // 用例85: 乘零测试2 - (-6) × 0 = 0
        test_x[84] = 32'hFFFFFFFA; test_y[84] = 32'd0; expected_result[84] = 64'd0;
        test_mul_div[84] = 0; test_x_signed[84] = 0; test_y_signed[84] = 0;
        test_description[84] = "(-6)x0=0";
        
        // 用例86: 乘零测试3 - 0 × 9 = 0
        test_x[85] = 32'd0; test_y[85] = 32'd9; expected_result[85] = 64'd0;
        test_mul_div[85] = 0; test_x_signed[85] = 1; test_y_signed[85] = 1;
        test_description[85] = "0x9=0";
        
        // 用例87: 乘零测试4 - 0 × (-9) = 0
        test_x[86] = 32'd0; test_y[86] = 32'hFFFFFFF7; expected_result[86] = 64'd0;
        test_mul_div[86] = 0; test_x_signed[86] = 0; test_y_signed[86] = 0;
        test_description[86] = "0x(-9)=0";
        
        // 用例88: 最大无符号乘法 - 4294967295 × 4294967295 = 18446744065119617025
        test_x[87] = 32'hFFFFFFFF; test_y[87] = 32'hFFFFFFFF; expected_result[87] = 64'hFFFFFFFE00000001;
        test_mul_div[87] = 0; test_x_signed[87] = 1; test_y_signed[87] = 1;
        test_description[87] = "MAX_UxMAX_U";
        
        // 用例89: 最大有符号乘法 - 2147483647 × 2147483647 = 4611686014132420609
        test_x[88] = 32'd2147483647; test_y[88] = 32'd2147483647; expected_result[88] = 64'd4611686014132420609;
        test_mul_div[88] = 0; test_x_signed[88] = 0; test_y_signed[88] = 0;
        test_description[88] = "MAXxMAX";
        
        // 用例90: 极值乘法 - (-2147483648) × 2147483647 = -4611686016279904256
        test_x[89] = 32'h80000000; test_y[89] = 32'd2147483647; expected_result[89] = 64'hC000000080000000;
        test_mul_div[89] = 0; test_x_signed[89] = 0; test_y_signed[89] = 0;
        test_description[89] = "MINxMAX";
        
        // 用例91: 除1测试1 - 6 ÷ 1 = 6
        test_x[90] = 32'd6; test_y[90] = 32'd1; expected_result[90] = {32'd6, 32'd0};
        test_mul_div[90] = 1; test_x_signed[90] = 1; test_y_signed[90] = 1;
        test_description[90] = "6/1=6";
        
        // 用例92: 除1测试2 - (-6) ÷ 1 = -6
        test_x[91] = 32'hFFFFFFFA; test_y[91] = 32'd1; expected_result[91] = {32'hFFFFFFFA, 32'd0};
        test_mul_div[91] = 1; test_x_signed[91] = 0; test_y_signed[91] = 0;
        test_description[91] = "(-6)/1=-6";
        
        // 用例93: 除1测试3 - 696969 ÷ 1 = 696969
        test_x[92] = 32'd696969; test_y[92] = 32'd1; expected_result[92] = {32'd696969, 32'd0};
        test_mul_div[92] = 1; test_x_signed[92] = 1; test_y_signed[92] = 1;
        test_description[92] = "696969/1=696969";
        
        // 用例94: 除1测试4 - (-696969) ÷ 1 = -696969
        test_x[93] = 32'hFFF5B737; test_y[93] = 32'd1; expected_result[93] = {32'hFFF5B737, 32'd0};
        test_mul_div[93] = 1; test_x_signed[93] = 0; test_y_signed[93] = 0;
        test_description[93] = "(-696969)/1=-696969";
        
        // 用例95: 自乘验证1 - 6 × 6 = 36
        test_x[94] = 32'd6; test_y[94] = 32'd6; expected_result[94] = 64'd36;
        test_mul_div[94] = 0; test_x_signed[94] = 1; test_y_signed[94] = 1;
        test_description[94] = "6x6=36";
        
        // 用例96: 自乘验证2 - 9 × 9 = 81
        test_x[95] = 32'd9; test_y[95] = 32'd9; expected_result[95] = 64'd81;
        test_mul_div[95] = 0; test_x_signed[95] = 1; test_y_signed[95] = 1;
        test_description[95] = "9x9=81";
        
        // 用例97: 自除验证1 - 36 ÷ 6 = 6
        test_x[96] = 32'd36; test_y[96] = 32'd6; expected_result[96] = {32'd6, 32'd0};
        test_mul_div[96] = 1; test_x_signed[96] = 1; test_y_signed[96] = 1;
        test_description[96] = "36/6=6";
        
        // 用例98: 自除验证2 - 81 ÷ 9 = 9
        test_x[97] = 32'd81; test_y[97] = 32'd9; expected_result[97] = {32'd9, 32'd0};
        test_mul_div[97] = 1; test_x_signed[97] = 1; test_y_signed[97] = 1;
        test_description[97] = "81/9=9";
        
        // 用例99: 最小正整数验证 - 1 × 1 = 1
        test_x[98] = 32'd1; test_y[98] = 32'd1; expected_result[98] = 64'd1;
        test_mul_div[98] = 0; test_x_signed[98] = 1; test_y_signed[98] = 1;
        test_description[98] = "1x1=1";
    end

    // ========== 简单计数器控制 ==========
    reg [6:0] test_counter;
    reg [63:0] current_expected;
    reg waiting_for_result;
    
    // 调试信号
    reg [79:0] current_desc;
    
    always @(posedge clk or negedge rst_n) begin
        if (!rst_n) begin
            test_counter <= 7'd0;
            test_pass_count <= 7'd0;
            test_fail_count <= 7'd0;
            test_complete <= 1'b0;
            current_test <= 7'd0;
            enable_in <= 1'b0;
            waiting_for_result <= 1'b0;
            x <= 32'd0;
            y <= 32'd0;
            mul0_div1 <= 1'b0;
            x_signed0_unsigned1 <= 1'b0;
            y_signed0_unsigned1 <= 1'b0;
            current_expected <= 64'd0;
            current_desc <= 80'd0;
        end else if (!test_complete) begin
            if (!waiting_for_result) begin
                // 启动新测试
                if (test_counter < TEST_COUNT) begin
                    current_test <= test_counter;
                    enable_in <= 1'b1;
                    waiting_for_result <= 1'b1;
                    
                    // 从查找表读取测试参数
                    x <= test_x[test_counter];
                    y <= test_y[test_counter];
                    mul0_div1 <= test_mul_div[test_counter];
                    x_signed0_unsigned1 <= test_x_signed[test_counter];
                    y_signed0_unsigned1 <= test_y_signed[test_counter];
                    current_expected <= expected_result[test_counter];
                    current_desc <= test_description[test_counter];
                end else begin
                    // 所有测试完成
                    test_complete <= 1'b1;
                end
            end else begin
                // 等待结果
                enable_in <= 1'b0;
                if (enable_out) begin
                    // 验证结果
                    if (z == current_expected) begin
                        test_pass_count <= test_pass_count + 1;
                    end else begin
                        test_fail_count <= test_fail_count + 1;
                    end
                    
                    // 准备下一个测试
                    waiting_for_result <= 1'b0;
                    test_counter <= test_counter + 1;
                end
            end
        end
    end

endmodule